package Finance::NSCC::Insurance::Schema::CommissionUnderlyingAsset;

use strict;
use warnings;

use base 'DBIx::Class';

__PACKAGE__->load_components("Core");
__PACKAGE__->table("commission_underlying_assets");
__PACKAGE__->add_columns(
  "nscc_control_num",
  { data_type => "CHAR", default_value => "", is_nullable => 0, size => 20 },
  "cusip",
  { data_type => "CHAR", default_value => "", is_nullable => 0, size => 9 },
  "fund_id",
  { data_type => "CHAR", default_value => "", is_nullable => 0, size => 5 },
  "sub_fund_id",
  { data_type => "CHAR", default_value => "", is_nullable => 0, size => 5 },
  "comm_basis_amt",
  { data_type => "DECIMAL", default_value => "", is_nullable => 0, size => 16 },
  "comm_basis_amt_q",
  { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 2 },
  "comm_rate",
  {
    data_type => "DECIMAL",
    default_value => undef,
    is_nullable => 1,
    size => 10,
  },
  "calc_comm_amt",
  { data_type => "DECIMAL", default_value => "", is_nullable => 0, size => 16 },
  "mutual_fund_cusip",
  { data_type => "CHAR", default_value => undef, is_nullable => 1, size => 9 },
);
__PACKAGE__->set_primary_key("nscc_control_num", "cusip", "fund_id", "sub_fund_id");

__PACKAGE__->belongs_to(commission => 'Finance::NSCC::Insurance::Schema::Commission',
                        {'foreign.nscc_control_num' => 'self.nscc_control_num'}
                       );

1;
